package com.chen.boot.controller;

import com.chen.boot.db.entity.ChatMessage;
import com.chen.boot.service.ChatMessageService;
import com.chen.common.Result;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description
 * @Author Pengwei
 * @CreatDate 2021/11/18 02:30
 */
@RestController
public class ChatMessageController {
    @Resource
    ChatMessageService chatMessageService;

    //用于接收文本消息
    @PostMapping("receiveText")
    public Result receiveTextMessage(@RequestBody ChatMessage chatMessage) {
        chatMessageService.receiveTextMessage(chatMessage);
        return Result.ok();
    }
}
